package com.tjetc.controller;

import com.tjetc.common.JsonResult;
import com.tjetc.common.vo.user.CommentParam;
import com.tjetc.entity.Comment;
import com.tjetc.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("comment")
public class CommentController {
    @Autowired
    CommentService commentService;
    @RequestMapping("add")
    JsonResult addComment(@RequestBody CommentParam commentParam) {
        return  commentService.addComment(commentParam);

    }
    @RequestMapping("read")
    JsonResult readComment(@RequestParam(name = "userId",required = false) Long userId,
                           @RequestParam("status") Long status,
                           @RequestParam("bindId") Long bindId,
                           @RequestParam(name = "upId",required = false) Long upId
                           ) {
        return  commentService.readComment(userId,status,bindId,upId);

    }
}
